//
//  SocketTypes.swift
//  QHSocketIODemo
//
//  Created by chen on 2017/5/15.
//  Copyright © 2017年 chen. All rights reserved.
//

import Foundation

public protocol SocketData {}

extension Array: SocketData {}
extension Bool: SocketData {}
extension Dictionary: SocketData {}
extension Double: SocketData {}
extension Int: SocketData {}
extension NSArray: SocketData {}
extension Data: SocketData {}
extension NSData: SocketData {}
extension NSDictionary: SocketData {}
extension NSString: SocketData {}
extension NSNull: SocketData {}
extension String: SocketData {}

public typealias AckCallback = ([Any]) -> Void
public typealias NormalCallback = ([Any], NSObject) -> Void

typealias JSON = [String: Any]
typealias Probe = (msg: String, type: SocketEnginePacketType, data: [Data])
typealias ProbeWaitQueue = [Probe]

enum Either<E, V> {
    case left(E)
    case right(V)
}
